<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>头部</title>
</head>
<body>
	<div class="top">
				<div class="top_1">
					<div class="top_1_left">
						<img src="img/LOGO-Neuedu【蓝】.png" />
					</div>
					<div class="top_1_middle">
						<div>
							<input type="text" name="search">
						</div>
						<div>
							<img src="img/搜索.svg" onclick="searchfun()"/>
						</div>
					</div>
					<script>
					function searchfun(){
						window.location.href='search.goods?gname='+document.getElementsByName("search")[0].value
					}
					</script>
					<div class="top_1_right">
						<a href="#">登录</a>|<a href="#">注册</a>
					</div>
				</div>
				
				<div class="top_2">
					
					<div class="lunbo">
						<div>
							<img src="img/lunbo01.jpg" /> 
						</div>
						<div>
							<img src="img/lunbo02.jpg" /> 
						</div>
						<div>
							<img src="img/lizi-1-shijiazhuang.jpg" />
					   </div>
					
		         </div>
					
					
				</div>
			</div>
			<script type="text/javascript">
			/*
			 1:找到所有div（含有img的）
			 2：设置i：用于表示那个div进行显示
			      不是i的元素隐藏
			 * */
			var lunbo=document.getElementsByClassName("lunbo")[0];
			console.log(lunbo)
			/*孩子*/
			var children=lunbo.children;
			console.log(children[0]+"    "+children[1]);
			
			var i=0;
			function fun(){
				i=i%children.length;
				for(var j=0;j<children.length;j++){
					if(i==j){
						children[j].setAttribute("style","display: block;")
					}else{
						children[j].setAttribute("style","display: none;")
					}
				}
				i++;
				
			}
			
			fun();
			setInterval("fun()",1000)/*每个1秒进行执行fun()函数
			*/
			</script>
</body>
</html>